/**
 * 
 * 广州锐鹏计算机科技有限公司（www.ruipengkj.com）
 * 
 * 
 * Copyright (c) 2011-2012 RUIPENGKJ.Co.Ltd. All rights reserved.
 * 
 * */
package com.ruipengkj.bean;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 说明：
 * Entity Name 商品库存
 * @Author：李智深
 * @Date：2012-03-14
 */
@Entity
@Table(name="ruipeng_tb_TStock")
public class TStock implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	private String StockID;//库存编号CHAR(15) PK
	
	private int Num;//库存数量INTEGER
	
//	private double AvgPrice;//加权价格DECIMAL(20,3)加权价=（库存数量*加权价+采购价*采购数量）/（库存数量+采购数量）
	
	private TCommodity TCommodity;//商品
	
	private TStore TStore;//仓库

	public TStock(){}
	public TStock(String stockID, int num) {
		super();
		StockID = stockID;
		Num = num;
	}
	
	public TStock(com.ruipengkj.bean.TStore tStore) {
		super();
		TStore = tStore;
	}
	@Id
	@Column(name = "StockID", length=15)
	public String getStockID() {
		return StockID;
	}

	public void setStockID(String stockID) {
		StockID = stockID;
	}

	@Column(name = "Num")
	public int getNum() {
		return Num;
	}

	public void setNum(int num) {
		Num = num;
	}

//	@Column(name = "AvgPrice", precision = 20, scale = 3)
//	public double getAvgPrice() {
//		return AvgPrice;
//	}
//
//	public void setAvgPrice(double avgPrice) {
//		AvgPrice = avgPrice;
//	}
	@ManyToOne
	@JoinColumn(name="CommodityID")
	public TCommodity getTCommodity() {
		return TCommodity;
	}

	public void setTCommodity(TCommodity tCommodity) {
		TCommodity = tCommodity;
	}
	@ManyToOne
	@JoinColumn(name="StoreID")
	public TStore getTStore() {
		return TStore;
	}

	public void setTStore(TStore tStore) {
		TStore = tStore;
	}
}
